﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharpMUD.Framework.ComponentModel.DecoratedBehavior
{
    public interface IDecorated<TBehaviorBase>
    {
        IEnumerable<TBehaviorBase> GetBehaviors();
        IEnumerable<TBehaviorBase> GetBehaviors(Predicate<TBehaviorBase> condition);

        bool HasBehavior<U>()
            where U : TBehaviorBase;
        bool HasBehavior<U>(bool strict)
            where U : TBehaviorBase;
        bool HasBehavior(Predicate<TBehaviorBase> condition);
    }

    public interface IDynamicallyDecorated<TBehaviorBase>
        : IDecorated<TBehaviorBase>
    {
        void AddBehavior<TBehavior, TBehaviorImplementor>()
            where TBehavior : TBehaviorBase
            where TBehaviorImplementor : TBehavior, new();

        void RemoveBehavior<TBehavior, TBehaviorImplementor>()
            where TBehavior : TBehaviorBase
            where TBehaviorImplementor : TBehavior, new();
    }

    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface,AllowMultiple=false,Inherited = false)]
    public sealed class BehaviorDefinitionAttribute
        : System.Attribute
    {

        public static bool IsValidBehaviorDefinition<TBehaviorDefinition>()
		{
			throw new NotImplementedException();
		}
    }

    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
    public sealed class BehaviorImplementationAttribute
        : System.Attribute
    {

        public static bool IsValidBehaviorImplementation<TBehaviorDefinition, TBehaviorImplementation>()
            where TBehaviorImplementation : TBehaviorDefinition
		{
			throw new NotImplementedException();
		}
    }
}
